const QQMapWX = require('@/utils/qqmap-wx-jssdk.min.js');
import configdata from '@/common/config.js'
const qqmapsdk = new QQMapWX({
	key: configdata.MapKey
});
//地址逆解析
export function AddressReverse(lat, lng) {
	return new Promise((resolve, reject) => {
		if (lat && lng) {
			qqmapsdk.reverseGeocoder({
				location: {
					latitude: lat,
					longitude: lng
				},
				success: (result) => resolve(result.result.formatted_addresses.recommend),
				fail: (err) => reject(err)
			});
		} else {
			resolve("");
		}
	});
}